package com.study.chunguard.common.exception;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 参数校验失败异常
 *
 * @author zhaowenhao
 * @version 2023-05-04
 */
public class ValidationFailedException extends RuntimeException {
    private final Map<String, List<String>> linkedEntities;

    public ValidationFailedException(String message) {
        super(message);
        this.linkedEntities = Collections.emptyMap();
    }

    public ValidationFailedException(String message, Map<String, List<String>> linkedEntities) {
        super(message);
        this.linkedEntities = linkedEntities;
    }

    public ValidationFailedException(String message, Throwable cause) {
        super(message, cause);
        this.linkedEntities = Collections.emptyMap();
    }

    public Map<String, List<String>> getLinkedEntities() {
        return linkedEntities;
    }
}
